function Tab(el,options = {})
{
//1 讲数据保存到this上
this.el = document.querySelector(el);
//2 写功能
this.init()
}
Tab.prototype.init = function(){
    //this===实例化对象tab1/tab2
    this.titleOver();
    this.titleOut();
};
Tab.prototype.titleOver = function(){
    //获取所有的标题
    let ulLiObjs = this.el.querySelectorAll("ul li")
    //2遍历
    ulLiObjs.forEach((item,i)=>{
          //3挨个绑定移入事件
        item.onmouseover = () =>{
              //3.1事件处理函数中 清除选中标题样式
            this.el.querySelector('ul li.active').className= ''
    //3.1事件处理函数中 给当前移入加
    item.className = 'active'
    //3.1同步内容
    this.el.querySelector("ol li.active").className = ''
    this.el.querySelector(`ol li:nth-of-type(${i+1})`).className = 'active'
        }
    
    })

};
Tab.prototype.titleOut = function(){};

export default Tab;